import request from '@/utils/request.js'

export const addclientservice = (data)=>{
  return request.post('/addClient',data)
}
export const updatecilentservice = (data)=>{
  return request.put('/updateClient',data)
}
export const deleteclientservice = (data)=>{
  return request.delete('/deleteClient?id=' + data)
}
export const getpartclientservice = (data) => {
  return request.post('/getClient', data);
}

export const addkeymanservice = (data)=>{
  return request.post('/addKeyMan?clientcompanyid='+data.clientcompanyid,data);
}
export const updatekeymanservice = (data)=>{
  return request.put('/updateKeyMan',data);
}
export const getpartkeymanservice = (data)=>{
  return request.get('/getKeyMan?str='+data.str+'&clientcompanyid='+data.clientcompanyid)
}
export const getKeyManByID = (data)=>{
  return request.get('/getKeyManByID?id='+data);
}





export const getallclientservice = () => {
  return request.get('/getAllClient');
}
export const getClientsComesByClientCompanyidservice = (data) => {
  return request.get('/getClientsComesByClientCompanyid?str='+data.str+'&clientcompanyid='+data.clientcompanyid)
}

export const addclientcomeservice = (data) => {
  return request.post('/addClientCome',data)
}
export const getAllUserForClientComeAddservice = () => {
  return request.get('/getAllUserForClientComeAdd')
}
export const updateclientcomeservice = (data) => {
  return request.put('/updateClientCome',data);
}


export const selectByStrForQuoteservice = (data) => {
  return request.get('/selectByStrForQuote?str='+data)
}

export const getchanceandclientservice = () => {
  return request.get('/getChanceAndClientForResult')
}

export const addquoteservice = (data) => {
  return request.post('/addQuote',data)
}

export const addquoteandproductionpsservice = (data,quoteid) => {
  return request.post('/addQuoteAndProductionPS?quoteid='+quoteid,data)
}

export const updatequotecomeservice = (data) => {
  return request.post('/updateQuote',data)
}

export const updatequoteandproductionpsservice = (data,quoteid) => {
  return request.put('/updateQuoteAndProductionPS?quoteid='+quoteid,data)
}

export const loadquoteproductionsservice = (quoteid) => {
  return request.get('/loadquoteproductions?quoteid='+quoteid)
}

export const getcontractsservice = (data) => {
  return request.post('/getContracts',data)
}

export const getPayPhaseByContractIdservice = (id) => {
  return request.get('/getPayPhaseByContractId?contractid='+id)
}

export const deletephaseservice = (id) => {
  return request.delete('/deletephase?id='+id)
}

export const updatecontractservice = (data) => {
  return request.post('/updateContract',data)
}

export const updatephaseservice = (contractid, data) => {
  return request.post('/updatePayPhase?contractid='+contractid,data)
}

export const updateoughttimecomeservice = (data) => {
  return request.put('/updateoughttime',data)
}

export const addinputservice = (data) => {
  return request.post('/addInput',data)
}

export const getinputsservice = (data) => {
  return request.post('/getInputs',data)
}

export const deleteinputservice = (id) => {
  return request.delete('/deleteInput?id='+id)
}

export const getresetpricesservice = (id) => {
  return request.get('/getresetprices?contractid='+id)
}

export const getPayPhasesforinquiryservice = (data) => {
  return request.post('/getPayPhasesForInquiry',data)
}
export const deletequoteservice = (id) => {
  return request.delete('/deletequote?id='+id)
}